package com.aiju.bean;

import com.aiju.utils.L;

/**
 * @author: 佐为
 * @date: 2016-12-28 18:52
 * @version: V1.0
 * @Description: 优惠券
 */
public class Discount {

    private int id; //主键id
    private String value; //面值
    private int type; //1:整单折扣 2:整单减价 3:满减 4:满折
    private int status;
    private String condition; //优惠条件
    private boolean account; //是否会员卡（使用时标记）
    private String memberPhone; //会员电话

    private String name;

    public void setName(String name) {
        this.name = name;
    }

    public String getMemberPhone() {
        return memberPhone;
    }

    public void setMemberPhone(String memberPhone) {
        this.memberPhone = memberPhone;
    }

    public int getComparator() {
        if (type == 2) {
            return 0;
        } else if (type == 1) {
            return 1;
        } else if (type == 3) {
            return 2;
        } else {
            return 3;
        }
    }

    public String getCondition() {
        return condition;
    }

    public void setCondition(String condition) {
        this.condition = condition;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public String getName() {
        return name;
    }

    public int getId() {
        return id;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public Double getDiscount() {
        L.d("折扣：" + Double.valueOf(value) / 10);
        return Double.valueOf(value) / 10;
    }

    public boolean isAccount() {

        return true;
    }

    public void setAccount(boolean account) {
        this.account = account;
    }
}
